package com.guoyu.gserv.action;
import com.guoyu.gserv.dao.UsrDAO;
import com.guoyu.gserv.entity.Usr;
import com.opensymphony.xwork2.ActionSupport;

public class UsrAct extends ActionSupport {

	private UsrDAO usrDAO;
	
	private Usr usr;

	public Usr getUsr() {
		return usr;
	}

	public void setUsr(Usr usr) {
		this.usr = usr;
	}

	public UsrDAO getUsrDAO() {
		return usrDAO;
	}

	public void setUsrDAO(UsrDAO usrDAO) {
		this.usrDAO = usrDAO;
	}

	public String save() {
		System.out.println("=============================================");
		System.out.println(usr.getName());
		System.out.println("=============================================");
		try {
			usrDAO.save(usr);
		} catch(Throwable ex) {
			return ERROR;
		}
		return SUCCESS;
	}
}
